Developer Documentation
PATH  Mac OS X Documentation > Developer Tools > Mac OS X Assembler Guide


Previous | Contents | Next

Comment Field

The assembler recognizes two types of comments in source code:

# line_number file_name level

get turned into

.line line_number ; .file file_name

This can cause problems when comments of this form which aren't intended to specify line numbers precede assembly errors, since the error will be reported as occurring on a line relative to that specified in the comment. Suppose a program contains these two lines of assembly source:

# 500
.var

If ".var" hasn't been defined, this fragment will result in the following error message:

var.s:500:Unknown pseudo-op: .var

An assembly language source line can consist of just the comment field; in this case, it's equivalent to using the hash character comment style:

# This is a comment. ; This is a comment.

Note the warning given above for hash character comments beginning with a number.


Mac OS X Assembler Guide: ASM Layout

Previous | Contents | Next